﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.d00_zjs_zcMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>d00_zjs_zc</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = d00_zjs_zc_MainStore.getAt(index).get('dzbm');
            
			Txtrbh.setValue(d00_zjs_zc_MainStore.getAt(index).get('rbh'));
			Txtxh.setValue(d00_zjs_zc_MainStore.getAt(index).get('xh'));
			Txthzxm.setValue(d00_zjs_zc_MainStore.getAt(index).get('hzxm'));
			Txtxm.setValue(d00_zjs_zc_MainStore.getAt(index).get('xm'));
			Txthzgx.setValue(d00_zjs_zc_MainStore.getAt(index).get('hzgx'));
			Txtxb.setValue(d00_zjs_zc_MainStore.getAt(index).get('xb'));
			Txtcsrq.setValue(d00_zjs_zc_MainStore.getAt(index).get('csrq'));
			Txthyzk.setValue(d00_zjs_zc_MainStore.getAt(index).get('hyzk'));
			Txtmz.setValue(d00_zjs_zc_MainStore.getAt(index).get('mz'));
			Txtsfzh.setValue(d00_zjs_zc_MainStore.getAt(index).get('sfzh'));
			Txtcsd.setValue(d00_zjs_zc_MainStore.getAt(index).get('csd'));
			Txtlsdh.setValue(d00_zjs_zc_MainStore.getAt(index).get('lsdh'));
			TxtNumjtrs.setValue(d00_zjs_zc_MainStore.getAt(index).get('jtrs'));
			TxtNumcjrs.setValue(d00_zjs_zc_MainStore.getAt(index).get('cjrs'));
			TxtNumtsrs.setValue(d00_zjs_zc_MainStore.getAt(index).get('tsrs'));
			Txthsx.setValue(d00_zjs_zc_MainStore.getAt(index).get('hsx'));
			Txtjfje.setValue(d00_zjs_zc_MainStore.getAt(index).get('jfje'));
			Txtjfsj.setValue(d00_zjs_zc_MainStore.getAt(index).get('jfsj'));
			Txtfphm.setValue(d00_zjs_zc_MainStore.getAt(index).get('fphm'));
			Txtsfy.setValue(d00_zjs_zc_MainStore.getAt(index).get('sfy'));
			Txthbh.setValue(d00_zjs_zc_MainStore.getAt(index).get('hbh'));
			Txtbz3.setValue(d00_zjs_zc_MainStore.getAt(index).get('bz3'));
			Txtbz4.setValue(d00_zjs_zc_MainStore.getAt(index).get('bz4'));
			Txtbz1.setValue(d00_zjs_zc_MainStore.getAt(index).get('bz1'));
			Txtbz2.setValue(d00_zjs_zc_MainStore.getAt(index).get('bz2'));
			TxtNumid.setValue(d00_zjs_zc_MainStore.getAt(index).get('id'));
			Txtjgdm.setValue(d00_zjs_zc_MainStore.getAt(index).get('jgdm'));

            d00_zjs_zc_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--d00_zjs_zc表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="d00_zjs_zc_MainStore" OnRefreshData="d00_zjs_zc_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="dzbm">
                <Fields>
                    
					<ext:RecordField Name="dzbm" />
					<ext:RecordField Name="rbh" />
					<ext:RecordField Name="xh" />
					<ext:RecordField Name="hzxm" />
					<ext:RecordField Name="xm" />
					<ext:RecordField Name="hzgx" />
					<ext:RecordField Name="xb" />
					<ext:RecordField Name="csrq" />
					<ext:RecordField Name="hyzk" />
					<ext:RecordField Name="mz" />
					<ext:RecordField Name="sfzh" />
					<ext:RecordField Name="csd" />
					<ext:RecordField Name="lsdh" />
					<ext:RecordField Name="jtrs" />
					<ext:RecordField Name="cjrs" />
					<ext:RecordField Name="tsrs" />
					<ext:RecordField Name="hsx" />
					<ext:RecordField Name="jfje" />
					<ext:RecordField Name="jfsj" />
					<ext:RecordField Name="fphm" />
					<ext:RecordField Name="sfy" />
					<ext:RecordField Name="hbh" />
					<ext:RecordField Name="bz3" />
					<ext:RecordField Name="bz4" />
					<ext:RecordField Name="bz1" />
					<ext:RecordField Name="bz2" />
					<ext:RecordField Name="id" />
					<ext:RecordField Name="jgdm" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--d00_zjs_zc页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="d00_zjs_zc_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="d00_zjs_zc_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{d00_zjs_zc_MainForm}.getForm().reset();#{Hid}.setValue('');#{d00_zjs_zc_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{d00_zjs_zc_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{d00_zjs_zc_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(d00_zjs_zc_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="d00_zjs_zc_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="dzbm" />
                                
								<ext:Column Header="rbh" Sortable="true" DataIndex="rbh" />
								<ext:Column Header="xh" Sortable="true" DataIndex="xh" />
								<ext:Column Header="hzxm" Sortable="true" DataIndex="hzxm" />
								<ext:Column Header="xm" Sortable="true" DataIndex="xm" />
								<ext:Column Header="hzgx" Sortable="true" DataIndex="hzgx" />
								<ext:Column Header="xb" Sortable="true" DataIndex="xb" />
								<ext:Column Header="csrq" Sortable="true" DataIndex="csrq" />
								<ext:Column Header="hyzk" Sortable="true" DataIndex="hyzk" />
								<ext:Column Header="mz" Sortable="true" DataIndex="mz" />
								<ext:Column Header="sfzh" Sortable="true" DataIndex="sfzh" />
								<ext:Column Header="csd" Sortable="true" DataIndex="csd" />
								<ext:Column Header="lsdh" Sortable="true" DataIndex="lsdh" />
								<ext:Column Header="jtrs" Sortable="true" DataIndex="jtrs" />
								<ext:Column Header="cjrs" Sortable="true" DataIndex="cjrs" />
								<ext:Column Header="tsrs" Sortable="true" DataIndex="tsrs" />
								<ext:Column Header="hsx" Sortable="true" DataIndex="hsx" />
								<ext:Column Header="jfje" Sortable="true" DataIndex="jfje" />
								<ext:Column Header="jfsj" Sortable="true" DataIndex="jfsj" />
								<ext:Column Header="fphm" Sortable="true" DataIndex="fphm" />
								<ext:Column Header="sfy" Sortable="true" DataIndex="sfy" />
								<ext:Column Header="hbh" Sortable="true" DataIndex="hbh" />
								<ext:Column Header="bz3" Sortable="true" DataIndex="bz3" />
								<ext:Column Header="bz4" Sortable="true" DataIndex="bz4" />
								<ext:Column Header="bz1" Sortable="true" DataIndex="bz1" />
								<ext:Column Header="bz2" Sortable="true" DataIndex="bz2" />
								<ext:Column Header="id" Sortable="true" DataIndex="id" />
								<ext:Column Header="jgdm" Sortable="true" DataIndex="jgdm" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="d00_zjs_zc_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="rbh" />
								<ext:StringFilter DataIndex="xh" />
								<ext:StringFilter DataIndex="hzxm" />
								<ext:StringFilter DataIndex="xm" />
								<ext:StringFilter DataIndex="hzgx" />
								<ext:StringFilter DataIndex="xb" />
								<ext:StringFilter DataIndex="csrq" />
								<ext:StringFilter DataIndex="hyzk" />
								<ext:StringFilter DataIndex="mz" />
								<ext:StringFilter DataIndex="sfzh" />
								<ext:StringFilter DataIndex="csd" />
								<ext:StringFilter DataIndex="lsdh" />
								<ext:StringFilter DataIndex="hsx" />
								<ext:StringFilter DataIndex="jfje" />
								<ext:StringFilter DataIndex="jfsj" />
								<ext:StringFilter DataIndex="fphm" />
								<ext:StringFilter DataIndex="sfy" />
								<ext:StringFilter DataIndex="hbh" />
								<ext:StringFilter DataIndex="bz3" />
								<ext:StringFilter DataIndex="bz4" />
								<ext:StringFilter DataIndex="bz1" />
								<ext:StringFilter DataIndex="bz2" />
								<ext:StringFilter DataIndex="jgdm" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="d00_zjs_zc_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--d00_zjs_zc表修改，添加主窗体-->
    <ext:Window ID="d00_zjs_zc_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="d00_zjs_zc_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="420" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtrbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rbh" />
							<ext:TextField ID="Txthzxm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hzxm" />
							<ext:TextField ID="Txthzgx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hzgx" />
							<ext:TextField ID="Txtcsrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="csrq" />
							<ext:TextField ID="Txtmz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="mz" />
							<ext:TextField ID="Txtcsd" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="csd" />
							<ext:NumberField ID="TxtNumjtrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jtrs" />
							<ext:NumberField ID="TxtNumtsrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="tsrs" />
							<ext:TextField ID="Txtjfje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jfje" />
							<ext:TextField ID="Txtfphm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fphm" />
							<ext:TextField ID="Txthbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hbh" />
							<ext:TextField ID="Txtbz4" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bz4" />
							<ext:TextField ID="Txtbz2" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bz2" />
							<ext:TextField ID="Txtjgdm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jgdm" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtxh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xh" />
							<ext:TextField ID="Txtxm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xm" />
							<ext:TextField ID="Txtxb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xb" />
							<ext:TextField ID="Txthyzk" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hyzk" />
							<ext:TextField ID="Txtsfzh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sfzh" />
							<ext:TextField ID="Txtlsdh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="lsdh" />
							<ext:NumberField ID="TxtNumcjrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="cjrs" />
							<ext:TextField ID="Txthsx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hsx" />
							<ext:TextField ID="Txtjfsj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jfsj" />
							<ext:TextField ID="Txtsfy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sfy" />
							<ext:TextField ID="Txtbz3" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bz3" />
							<ext:TextField ID="Txtbz1" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bz1" />
							<ext:NumberField ID="TxtNumid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="id" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{d00_zjs_zc_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{d00_zjs_zc_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
